package org.example.config;

import org.example.BettingServer;
import org.example.router.RequestRouter;

public class ServerAutoConfiguration {

    private final ServerProperties properties;

    public ServerAutoConfiguration() {
        this.properties = new ServerProperties();
    }

    public ServerAutoConfiguration(ServerProperties properties) {
        this.properties = properties;
    }

    public BettingServer bettingServer() {
        BettingServer server = new BettingServer();
        server.setPort(properties.getPort());
        server.setThreadPoolSize(properties.getThreadPoolSize());
        return server;
    }
    public RequestRouter requestRouter() {
        return new RequestRouter();
    }

    public ServerProperties serverProperties() {
        return properties;
    }
}
